<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../../index.php' ); 
}
include("../../conf/connect.php");
	$user_id = $_SESSION['user_id'];
	$qus_no = $_GET['qus'];
	$hid = $_SESSION['usrHHid'];
	$bid = $_GET['bid'];
	$mmid = $_GET['mmid'];
	

  if($qus_no =='upd'){
    $serial = $_POST['qusNo'];
	$hid = $_POST['hhhid'];
	$bid = $_POST['bid'];
	$mmid = $_POST['memid'];
	header( "location: uqp1.php?serial=$serial&hid=$hid&bid=$bid&mmid=$mmid" );
  }   
  else if($qus_no =='upd1'){
    $serial = $_POST['qusNo'];
	$hid = $_POST['hhhid'];
	$bid = $_POST['bid'];
	header( "location: uqp2.php?serial=$serial&hid=$hid&bid=$bid" );
  } 
  else if($qus_no =='upd2'){
    $serial = $_POST['qusNo'];
	$hid = $_POST['hhhid'];
	$bid = $_POST['bid'];
	header( "location: uqp3.php?serial=$serial&hid=$hid&bid=$bid" );
  } 
  else if($qus_no =='upd3'){
    $serial = $_POST['qusNo'];
	$hid = $_POST['hhhid'];
	$bid = $_POST['bid'];
	header( "location: uqp4.php?serial=$serial&hid=$hid&bid=$bid" );
  } 
  else if($qus_no =='q1'){
	$name = $_POST["data"]["name"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
  
  else if($qus_no =='q2'){
  	$age = $_POST["data"]["1st"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$age' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$age' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
	
  }
  else if($qus_no =='q3'){
  	$sex = $_POST["data"]["sex"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$sex' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$sex' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q4'){
  	$mStatus = $_POST["data"]["mStatus"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$mStatus' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$mStatus' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q5'){
  	$relation = $_POST["data"]["relation"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$relation' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$relation' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
   else if($qus_no =='q6'){
   	$schooling = $_POST["data"]["s1"].$_POST["data"]["s2"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$schooling' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$schooling' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
   else if($qus_no =='q7'){
   	$occupation = $_POST["data"]["occupation"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$occupation' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$occupation' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
  
  else if($qus_no =='q8'){
	$doctor_visit = $_POST["data"]["visit"];
	$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$doctor_visit' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$doctor_visit' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q9'){
  		$disease_1 = $_POST["data"]["diseases_g"];
		$disease_2 = $_POST["data"]["diseases_d"];
		$disease_3 = $_POST["data"]["diseases_di"];
		$disease_4 = $_POST["data"]["diseases_o"];
		$ods = $_POST['ods'];
		$disease = '';
		if ($disease_1 !=''){
							$disease=$disease."Gastric,";
					}
		if ($disease_2!=''){
							$disease=$disease."Hrt Cnd,";
					}
		if ($disease_3!=''){
							$disease=$disease."Diabetes,";
					}
		if ($disease_4!=''){
							$disease=$disease.$ods;
					}
		
		$hid = $_POST['hid'];
	if($bid ==1)
		$sql="Update raw_data set $qus_no = '$disease' where user_id='$user_id' and hid='$hid' and rid='$bid'";
	else if($bid ==2)
		$sql="Update raw_data set $qus_no = '$disease' where user_id='$user_id' and hid='$hid' and rid='$bid' and id ='$mmid'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_detail.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q10'){
   	$hc01_1 = $_POST['hc01_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc01_1 = '$hc01_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q11'){
   	$hc01_2 = $_POST['hc01_2'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc01_2 = '$hc01_2' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q12'){
   	$hc01_3 = $_POST['hc01_3'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc01_3 = '$hc01_3' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q13'){
   	$hc01_4 = $_POST['hc01_4'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc01_4 = '$hc01_4' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q14'){
   	$hc05 = $_POST['hc05'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc05 = '$hc05' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q15'){
   	$hc06 = $_POST['hc06'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc06 = '$hc06' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q16'){
   	$hc07 = $_POST['hc07'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc07 = '$hc07' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q17'){
   	$hc08 = $_POST['hc08'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc08 = '$hc08' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q18'){
   	$hc09 = $_POST['hc09'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc09 = '$hc09' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q19'){
   	$hc02 = $_POST['hc02'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc02 = '$hc02' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  /*
   else if($qus_no =='q20'){
   	$hc02 = $_POST['hc02'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc02 = '$hc02' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  */
   else if($qus_no =='q22'){
   	$hc10 = $_POST['hc10'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc10 = '$hc10' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q23'){
   	$hc11 = $_POST['hc11'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc11 = '$hc11' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q24'){
   	$hc12 = $_POST['hc12'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc12 = '$hc12' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q25'){
   	$hc13 = $_POST['hc13'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc13 = '$hc13' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q26'){
   	$hc14 = $_POST['hc14'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc14 = '$hc14' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q27'){
   	$hc15 = $_POST['hc15'];
	$hid = $_POST['hid'];
		$sql="Update household_info set hc15 = '$hc15' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q28'){
   	$hc16 = $_POST['hc16'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h16 = '$hc16' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q29'){
   	$hc17 = $_POST['hc17'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h17 = '$hc17' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q30'){
   	$hc18 = $_POST['hc18'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h18 = '$hc18' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q31'){
   	$h19 = $_POST['h19'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h19 = '$h19' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q32'){
   	$h20_1 = $_POST['h20_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h20_01 = '$h20_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q33'){
   	$h21_1 = $_POST['h21_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h21_01 = '$h21_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q34'){
   	$h22_1 = $_POST['h22_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h22_01 = '$h22_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q35'){
   	$h23_1 = $_POST['h23_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h23_01 = '$h23_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q36'){
   	$h24 = $_POST['h24'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h24 = '$h24' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q37'){
   	$h25 = $_POST['h25'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h25 = '$h25' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q38'){
   	$h26 = $_POST['h26'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h26 = '$h26' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q39'){
   	$h27 = $_POST['h27'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h27 = '$h27' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q40'){
   	$h28_a_1 = $_POST['h28_a_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h28_a_1 = '$h28_a_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q41'){
   	$h28_b_1 = $_POST['h28_b_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h28_b_1 = '$h28_b_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q42'){
   	$h28_c_1 = $_POST['h28_c_1'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h28_c_1 = '$h28_c_1' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q43'){
   	$h29 = $_POST['h29'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h29 = '$h29' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q44'){
   	$h30 = $_POST['h30'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h30 = '$h30' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q45'){
   	$h31 = $_POST['h31'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h31 = '$h31' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q46'){
   	$h32 = $_POST['h32'];
	$hid = $_POST['hid'];
		$sql="Update household_info set h32 = '$h32' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_hc.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q47'){
   	$ha_01 = $_POST['ha_01'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_01 = '$ha_01' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q48'){
   	$ha_02 = $_POST['ha_02'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_02 = '$ha_02' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q49'){
   	$ha_03 = $_POST['ha_03'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_03 = '$ha_03' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q50'){
   	$ha_04 = $_POST['ha_04'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_04 = '$ha_04' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q51'){
   	$ha_05 = $_POST['ha_05'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_05 = '$ha_05' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q52'){
   	$ha_06 = $_POST['ha_06'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_06 = '$ha_06' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q53'){
   	$ha_07 = $_POST['ha_07'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_07 = '$ha_07' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q54'){
   	$ha_08 = $_POST['ha_08'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_08 = '$ha_08' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q55'){
   	$ha_09 = $_POST['ha_09'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_09 = '$ha_09' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q56'){
   	$ha_10 = $_POST['ha_10'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_10 = '$ha_10' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q57'){
   	$ha_11 = $_POST['ha_11'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_11 = '$ha_11' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q58'){
   	$ha_12 = $_POST['ha_12'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_12 = '$ha_12' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q59'){
   	$ha_13 = $_POST['ha_13'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_13 = '$ha_13' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q60'){
   	$ha_14 = $_POST['ha_14'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_14 = '$ha_14' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q61'){
   	$ha_15 = $_POST['ha_15'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_15 = '$ha_15' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q62'){
   	$ha_16 = $_POST['ha_16'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_16 = '$ha_16' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q63'){
   	$ha_17 = $_POST['ha_17'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_17 = '$ha_17' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q64'){
   	$ha_18 = $_POST['ha_18'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_18 = '$ha_18' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q65'){
   	$ha_19 = $_POST['ha_19'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_19 = '$ha_19' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q66'){
   	$ha_20 = $_POST['ha_20'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_20 = '$ha_20' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q67'){
   	$ha_21 = $_POST['ha_21'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_21 = '$ha_21' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q68'){
   	$ha_22 = $_POST['ha_22'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_22 = '$ha_22' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q69'){
   	$ha_23 = $_POST['ha_23'];
	$hid = $_POST['hid'];
		$sql="Update household_asset set ha_23 = '$ha_23' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_asset.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q70'){
   	$heh01_a = $_POST['heh01_a'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_a = '$heh01_a' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q71'){
   	$heh01_b = $_POST['heh01_b'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_b = '$heh01_b' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q72'){
   	$heh01_c = $_POST['heh01_c'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_c = '$heh01_c' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q73'){
   	$heh01_d = $_POST['heh01_d'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_d = '$heh01_d' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q74'){
   	$heh01_e = $_POST['heh01_e'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_e = '$heh01_e' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q75'){
   	$heh01_f = $_POST['heh01_f'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_f = '$heh01_f' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q76'){
   	$heh01_g = $_POST['heh01_g'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh01_g = '$heh01_g' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q77'){
   	$heh02_a = $_POST['heh02_a'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_a = '$heh02_a' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q78'){
   	$heh02_b = $_POST['heh02_b'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_b = '$heh02_b' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q79'){
   	$heh02_c = $_POST['heh02_c'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_c = '$heh02_c' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q80'){
   	$heh02_d = $_POST['heh02_d'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_d = '$heh02_d' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q81'){
   	$heh02_e = $_POST['heh02_e'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_e = '$heh02_e' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q82'){
   	$heh02_f = $_POST['heh02_f'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_f = '$heh02_f' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q83'){
   	$heh02_g = $_POST['heh02_g'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh02_g = '$heh02_g' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q84'){
   	$heh03_a = $_POST['heh03_a'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_a = '$heh03_a' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q85'){
   	$heh03_b = $_POST['heh03_b'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_b = '$heh03_b' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q86'){
   	$heh03_c = $_POST['heh03_c'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_c = '$heh03_c' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q87'){
   	$heh03_d = $_POST['heh03_d'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_d = '$heh03_d' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q88'){
   	$heh03_e = $_POST['heh03_e'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_e = '$heh03_e' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q89'){
   	$heh03_f = $_POST['heh03_f'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_f = '$heh03_f' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  else if($qus_no =='q90'){
   	$heh03_g = $_POST['heh03_g'];
	$hid = $_POST['hid'];
		$sql="Update household_economic set heh03_g = '$heh03_g' where hid='$hid'";
	
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_economic.php?hhid=$hid&bid=$bid" );
  }
  
  
?>